import { Component, Input, OnInit } from '@angular/core';

import { formatDistance } from 'date-fns';

@Component({
  selector: 'app-discover-content-list',
  templateUrl: './discover-content-list.component.html',
  styleUrls: ['./discover-content-list.component.scss']
})
export class DiscoverContentListComponent implements OnInit {

  likes = 0;
  dislikes = 0;
  time = formatDistance(new Date(), new Date());

  @Input() list: [];

  constructor() { }

  ngOnInit() {
  }

  like(): void {
    this.likes = 1;
    this.dislikes = 0;
  }

  dislike(): void {
    this.likes = 0;
    this.dislikes = 1;
  }
}
